<?php

$address = "Agoo, La Union";
$address = " Valenzuela City";
$address = str_replace(" ", "+", $address);

$API_KEY = "AIzaSyB1WzpDetlJqZX_mGnfKMuOM8pIMKY2BCw";
$url = "https://maps.googleapis.com/maps/api/geocode/json?address=$address&key=$API_KEY";
echo $url;
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $url
));
$resp = curl_exec($curl);
curl_close($curl);

print_r($resp);